package com.lyc.day1031.demo3;

/**
 * @author ：Xiaochen
 * @date ：Created in 2022/10/31 17:30
 * @description：
 * @modified By：
 * @version:
 */
public class Boy implements Runnable{
    private BackCard bankCard;
    public Boy(BackCard backCard){
        this.bankCard=backCard;
    }
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            bankCard.setBalance(bankCard.getBalance()+1000);
            System.out.println(Thread.currentThread().getName()+"向卡中存入1000，卡中余额："+bankCard.getBalance());
        }
    }
}